#!/usr/bin/env bash

# translate_bash_to_guile.sh

# This file is part of Leah (Language editor and helper).

# Leah is part of Faridayix, an artificially intelligent computer
# operating system.

# Copyright (C) 2010 Scott C. MacCallum
# scottmaccal@gmail.com

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

function translate_bash_to_guile
{
  local bold_font="\e[1m"

  local default_font="\e[0m"

  local reverse_font="\e[7m"

  clear

  echo -e -n $reverse_font

  echo -e -n $bold_font

  printf "TRANSLATE BASH TO GUILE"

  echo -e -n $default_font

  printf "\n"

  printf "\n"

  echo -e -n $bold_font

  ls --almost-all

  echo -e -n $default_font

  printf "\n"

  printf "Your present working directory is: "

  echo -e -n $bold_font

  pwd

  echo -e -n $default_font

  printf "\n"

  printf "Do you see the file that you would like to translate? "

  echo -e -n $bold_font

  read see_file

  echo -e -n $default_font

    if [[ "$see_file" == "yes" || "$see_file" == "y" ]]; then
      printf "\n"

      read bash_file_name

      printf "What do you want to name the translated file? "

      read guile_file_name

      sed 's/function/(define/' $bash_file_name > bash_function_guile_define

      sed 's/printf/display/' bash_function_guile_define > bash_function_guile_display

      mv bash_function_guile_display $guile_file_name
    fi
}
translate_bash_to_guile
#EOF
